<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="created" content="2018-10-23T06:18:10.521000000">
    <meta name="changed" content="2021-07-18T10:59:00.000000000">
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Language" content="en">
    <title>
      Bit Extender
    </title>
    <link rel="stylesheet" type="text/css" href="../../style.css">
  </head>
  <body>
    <div class="maindiv">
      <h1>
        <img class="iconlibs" src="../../../../icons/6464/extender.png" alt="#########" width="32" height="32"> <em>Bit Extender</em>
      </h1>
      <table>
        <tbody>
          <tr>
            <td>
              <strong>Library:</strong>
            </td>
            <td>
              <a href="index.html">Wiring</a>
            </td>
          </tr>
          <tr>
            <td>
              <strong>Introduced:</strong>
            </td>
            <td>
              2.5.0 (in Base library, moved to Wiring in 2.7.0)
            </td>
          </tr>
          <tr>
            <td valign="top">
              <strong>Appearance:</strong>
            </td>
            <td valign="top">
			 <table>
                <tbody>
                  <tr>
                    <td>
                      <img class="appearancelibs" src="../../../../img-libs/extender.png" alt="#########" width="64" height="64">
                    </td>
                    <td>
                      <img class="appearancelibs" src="../../../../img-libs/extender1.png" alt="#########" width="64" height="64">
                    </td>
                  </tr>
                </tbody>
              </table>
            </td>
          </tr>
        </tbody>
      </table>
      <h2>
        Behavior
      </h2>
      <p>
        The bit extender transforms a value into a value of another bit width. If it's being transformed into a smaller bit width, it is simply truncated to keep the lowest-order bits. If it's being transformed into a large bit width, the lowest-order bits are the same, and you have a choice about what the additional high-order bits will be: They can all be 0, all be 1, all match the input's <q>sign bit</q> (its highest-order bit), or the component can have an additional one-bit input that determines the identity of these other bits.
      </p>
      <h2>
        Pins
      </h2>
      <dl>
        <dt>
          West edge (input, bit width from Bit Width In attribute)
        </dt>
        <dd>
          <p>
            The multi-bit input whose value is to be transformed.
          </p>
        </dd>
        <dt>
          East edge (output, bit width from Bit Width Out attribute)
        </dt>
        <dd>
          <p>
            The computed output.
          </p>
        </dd>
        <dt>
          North edge (input, bit width 1)
        </dt>
        <dd>
          <p>
            Specifies what the additional bits in the output should be. This pin is available only when the Extension Type attribute is <q>Input.</q>
          </p>
        </dd>
      </dl>
      <h2>
        Attributes
      </h2>
      <p>
        When the component is selected or being added, the digits <b class="tkeybd">0</b> through <b class="tkeybd">9</b> alter the <b class="propertie">Bit Width In</b> attribute and <b class="tkeybd">Alt-0</b> through <b class="tkeybd">Alt-9</b> alter its <b class="propertie">Bit Width Out</b> attribute.
      </p>
	  <div class="attliste">
      <dl>
        <dt>
          <b class="propertie">Bit Width In</b>
        </dt>
        <dd>
          The input's bit width.
        </dd>
        <dt>
          <b class="propertie">Bit Width Out</b>
        </dt>
        <dd>
          The output's bit width.
        </dd>
        <dt>
          <b class="propertie">Extension Type</b>
        </dt>
        <dd>
          Assuming the output bit width exceeds the input bit width, this attribute configures what the additional output bits should be. If <q>Zero</q> or <q>One,</q> the additional bits are 0 or 1 accordingly. If <q>Sign,</q> the additional bits are taken to match the highest-order bit in the input. And if <q>Input,</q> the component has a second input on its north side whose one-bit value is used for the additional bits.
        </dd>
      </dl>
	  </div>
      <h2>
        Poke Tool Behavior
      </h2>
      <p>
        None.
      </p>
      <h2>
        Text Tool Behavior
      </h2>
      <p>
        None.
      </p>
      <p>
        <b>Back to</b> <a href="../index.html">Library Reference</a>
      </p>
    </div>
  </body>
</html>
